package com.ruoyi.whc.service.impl;

import java.util.List;

import com.ruoyi.whc.domain.CheckAreaId;
import org.springframework.stereotype.Service;
import com.ruoyi.whc.mapper.CheckpointMapper;
import com.ruoyi.whc.domain.Checkpoint;
import com.ruoyi.whc.service.ICheckpointService;

import javax.annotation.Resource;

/**
 * 检测点管理Service业务层处理
 * 
 * @author whc
 * @date 2022-09-22
 */
@Service
public class CheckpointServiceImpl implements ICheckpointService 
{
    @Resource
    private CheckpointMapper checkpointMapper;

    /**
     * 查询检测点管理
     * 
     * @param cpid 检测点管理主键
     * @return 检测点管理
     */
    @Override
    public Checkpoint selectCheckpointByCpid(Long cpid)
    {
        return checkpointMapper.selectCheckpointByCpid(cpid);
    }

    /**
     * 查询检测点管理列表
     * 
     * @param checkpoint 检测点管理
     * @return 检测点管理
     */
    @Override
    public List<Checkpoint> selectCheckpointList(Checkpoint checkpoint)
    {
        return checkpointMapper.selectCheckpointList(checkpoint);
    }

    /**
     * 新增检测点管理
     * 
     * @param checkpoint 检测点管理
     * @return 结果
     */
    @Override
    public int insertCheckpoint(Checkpoint checkpoint)
    {
        return checkpointMapper.insertCheckpoint(checkpoint);
    }

    /**
     * 修改检测点管理
     * 
     * @param checkpoint 检测点管理
     * @return 结果
     */
    @Override
    public int updateCheckpoint(Checkpoint checkpoint)
    {
        return checkpointMapper.updateCheckpoint(checkpoint);
    }

    /**
     * 批量删除检测点管理
     * 
     * @param cpids 需要删除的检测点管理主键
     * @return 结果
     */
    @Override
    public int deleteCheckpointByCpids(Long[] cpids)
    {
        return checkpointMapper.deleteCheckpointByCpids(cpids);
    }

    /**
     * 删除检测点管理信息
     * 
     * @param cpid 检测点管理主键
     * @return 结果
     */
    @Override
    public int deleteCheckpointByCpid(Long cpid)
    {
        return checkpointMapper.deleteCheckpointByCpid(cpid);
    }


    //根据区名字，查询出areaid
    @Override
    public CheckAreaId selectCheckPoint(String deptName) {
        return checkpointMapper.selectCheckPoint(deptName);
    }

}
